--- a/src/drtables.c
+++ b/src/drtables.c
@@ -662,7 +662,7 @@ addlookupmodule(NULL, &ibase_lookup_modu
 addlookupmodule(NULL, &ldap_lookup_module_info);
 #endif
 
-#ifdef LOOKUP_JSON
+#if defined(LOOKUP_JSON) && LOOKUP_JSON!=2
 addlookupmodule(NULL, &json_lookup_module_info);
 #endif
 
